<script lang="ts" setup name="App">
  import Person from './components/Person.vue'
  import { ref } from 'vue'

  // 数据
  let t1 = ref();
  let ren = ref();

  // 方法
  function showLog () {
    console.log("人=>", ren.value.a);
    // console.log("dom数据=>", t1.value);
  }
</script>

<template>
  <div class="box">
    <h2 ref="t1">你好</h2>
    <button @click="showLog()">触发按钮</button>
    <Person ref="ren" />
  </div>
</template>
<style scoped>
  .box {
    width: 500px;
    height: 300px;
    border: 1px solid orange;
    padding: 50px;
  }

  h2 {
    background-color: aquamarine;
  }
</style>